﻿
#include <iostream>
#include "../../win_com/xx_sock.hpp"
#include "wepoll.h"

void test_con()
{
    xsock sock;
    sock.tcp_create();
    sock.set_nonblock(0);
    sock.connect("220.181.38.148", 80);
}

void test_epoll()
{
    HANDLE ee = epoll_create(1000);
    

    xsock sock;
    sock.tcp_create();
    sock.set_nonblock(0);
    sock.connect("220.181.38.148", 80);

    epoll_event ev;
    ev.events = EPOLLOUT | EPOLLIN;
    ev.data.ptr = &sock;
    int ret = epoll_ctl(ee, EPOLL_CTL_ADD, sock.sock_, &ev);
    while (1)
    {
        epoll_event evs[100] = { 0 };
        int ev_cnt = epoll_wait(ee, evs, 100, -1);

        printf("ev_cnt = %u\n", ev_cnt);
    }
}
int main()
{
    INIT_NET;

    test_epoll();


    return 0;
}


